@extends('layout.index');
@section('title', '分类修改');
@section('content')
	     <div class="row">
	                <div class="col-lg-12">
	                    <h1 class="page-header">分类修改</h1>
	                </div>
	                <!-- /.col-lg-12 -->
	 		</div>
	 		<div class="row">
	                <div class="col-lg-4">
					<!-- 表单验证 错误提示位置 -->
			         @if (count($errors) > 0)
		                <div class="alert alert-danger alert-dismissable">
		                    <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
			                    <ul>
			                        @foreach ($errors->all() as $error)
			                            <li>{{ $error }}</li>
			                        @endforeach
			                    </ul>
		                </div>
			         @endif
	                    <form role="form" action="/admin/class/update" method="post" >
	                        <div class="form-group">
	                            <label>用户名</label>
	                            <input class="form-control username" name="classname" value="{{$res->classname}}" type="text">
	                            <p class="help-block"></p> 
	                        </div>
	                 
							<!-- 设置隐藏域 传递id -->
                            <input name="id" value="{{$res->id}}" type="hidden">

	                       <button class="btn btn-info" type="submit">修改</button>
	                       <button class="btn btn-info" type="reset">重置</button>
	                       {{csrf_field()}}
	                    </form>
	                </div>
	                                <!-- /.col-lg-6 (nested) -->
	       </div> 

	       @section('script')
    <script type="text/javascript">
 		//获取name的val
 		var res = $('.username').val();
 		console.log(res);
    </script>
@endsection
@endsection